import java.util.List;

import com.corpit.seaasia.entity.ConferenceEvent;

/**
 ***************************************************** 
 * ListDataAdapter
 ***************************************************** 
 */
public class ListDataAdapter extends BaseAdapter {
	private Context context;
	private List<Xml> data;
	private LayoutInflater mInflater;

	public ListDataAdapter(Context context, List<Xml> data) {
		mInflater = LayoutInflater.from(context);
		this.context = context;
		this.data = data;
	}
	/**
	 * 
	  *****************************************************
	  * 方法简介: 刷新Adapter
	  * @param list 
	  *****************************************************
	 */
	public void updateListView(List<Xml> list) {
		this.data = list;
		notifyDataSetChanged();
	}
	@Override
	public int getCount() {
		return data.size();
	}

	@Override
	public Object getItem(int position) {
		return data.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView,ViewGroup viewgroup) {
		ViewHolder holder = null;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = mInflater.inflate(R.layout.list_data_adapter, null);
			holder.Title = (TextView) convertView.findViewById(R.id.title);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		if (data != null) {
			holder.Title.setText(data.get(position).valeu);
		}
		return convertView;

	}
	// 实体类
	class ViewHolder {
		TextView Title;
	}
}